package com.aiyige.model.eshop;

import android.os.Parcel;
import android.os.Parcelable;

import com.aiyige.model.moment.backup.CommodityBackup;
import com.aiyige.model.tag.Tag;

import java.util.List;

/**
 * Created by zhuyakun on 2018/1/29.
 */

public class ProductsBackup implements Parcelable{
    String id;
    String orderId;
    String orderCode;
    String productId;
    String skuId;
    String momentId;
    String channel;
    String subject;
    String title;
    List<String> cover;
    String categoryId;
    String cityId;
    Integer count;
    String router;
    List<Tag> tags;
    CommodityBackup commodityBackup;
    String sellerId;
    SellerBackup sellerBackup;
    Integer status;
    DetailBackup detailBackup;
    Long orginId;
    Long createTime;
    Long updateTime;
    MediaSummary mediaSummary;

    Integer version;// 版本

    public ProductsBackup() {
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getOrderCode() {
        return orderCode;
    }

    public void setOrderCode(String orderCode) {
        this.orderCode = orderCode;
    }

    public String getProductId() {
        return productId;
    }

    public void setProductId(String productId) {
        this.productId = productId;
    }

    public String getSkuId() {
        return skuId;
    }

    public void setSkuId(String skuId) {
        this.skuId = skuId;
    }

    public String getMomentId() {
        return momentId;
    }

    public void setMomentId(String momentId) {
        this.momentId = momentId;
    }

    public String getChannel() {
        return channel;
    }

    public void setChannel(String channel) {
        this.channel = channel;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public List<String> getCover() {
        return cover;
    }

    public void setCover(List<String> cover) {
        this.cover = cover;
    }

    public String getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(String categoryId) {
        this.categoryId = categoryId;
    }

    public String getCityId() {
        return cityId;
    }

    public void setCityId(String cityId) {
        this.cityId = cityId;
    }

    public Integer getCount() {
        return count == null ? 0: count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public String getRouter() {
        return router;
    }

    public void setRouter(String router) {
        this.router = router;
    }

    public List<Tag> getTags() {
        return tags;
    }

    public void setTags(List<Tag> tags) {
        this.tags = tags;
    }

    public CommodityBackup getCommodityBackup() {
        return commodityBackup;
    }

    public void setCommodityBackup(CommodityBackup commodityBackup) {
        this.commodityBackup = commodityBackup;
    }

    public String getSellerId() {
        return sellerId;
    }

    public void setSellerId(String sellerId) {
        this.sellerId = sellerId;
    }

    public SellerBackup getSellerBackup() {
        return sellerBackup;
    }

    public void setSellerBackup(SellerBackup sellerBackup) {
        this.sellerBackup = sellerBackup;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public DetailBackup getDetailBackup() {
        return detailBackup;
    }

    public void setDetailBackup(DetailBackup detailBackup) {
        this.detailBackup = detailBackup;
    }

    public Long getOrginId() {
        return orginId;
    }

    public void setOrginId(Long orginId) {
        this.orginId = orginId;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    public Long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Long updateTime) {
        this.updateTime = updateTime;
    }

    public MediaSummary getMediaSummary() {
        return mediaSummary;
    }

    public void setMediaSummary(MediaSummary mediaSummary) {
        this.mediaSummary = mediaSummary;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.id);
        dest.writeString(this.orderId);
        dest.writeString(this.orderCode);
        dest.writeString(this.productId);
        dest.writeString(this.skuId);
        dest.writeString(this.momentId);
        dest.writeString(this.channel);
        dest.writeString(this.subject);
        dest.writeString(this.title);
        dest.writeStringList(this.cover);
        dest.writeString(this.categoryId);
        dest.writeString(this.cityId);
        dest.writeValue(this.count);
        dest.writeString(this.router);
        dest.writeTypedList(this.tags);
        dest.writeParcelable(this.commodityBackup, flags);
        dest.writeString(this.sellerId);
        dest.writeParcelable(this.sellerBackup, flags);
        dest.writeValue(this.status);
        dest.writeParcelable(this.detailBackup, flags);
        dest.writeValue(this.orginId);
        dest.writeValue(this.createTime);
        dest.writeValue(this.updateTime);
        dest.writeParcelable(this.mediaSummary, flags);
        dest.writeValue(this.version);
    }

    protected ProductsBackup(Parcel in) {
        this.id = in.readString();
        this.orderId = in.readString();
        this.orderCode = in.readString();
        this.productId = in.readString();
        this.skuId = in.readString();
        this.momentId = in.readString();
        this.channel = in.readString();
        this.subject = in.readString();
        this.title = in.readString();
        this.cover = in.createStringArrayList();
        this.categoryId = in.readString();
        this.cityId = in.readString();
        this.count = (Integer) in.readValue(Integer.class.getClassLoader());
        this.router = in.readString();
        this.tags = in.createTypedArrayList(Tag.CREATOR);
        this.commodityBackup = in.readParcelable(CommodityBackup.class.getClassLoader());
        this.sellerId = in.readString();
        this.sellerBackup = in.readParcelable(SellerBackup.class.getClassLoader());
        this.status = (Integer) in.readValue(Integer.class.getClassLoader());
        this.detailBackup = in.readParcelable(DetailBackup.class.getClassLoader());
        this.orginId = (Long) in.readValue(Long.class.getClassLoader());
        this.createTime = (Long) in.readValue(Long.class.getClassLoader());
        this.updateTime = (Long) in.readValue(Long.class.getClassLoader());
        this.mediaSummary = in.readParcelable(MediaSummary.class.getClassLoader());
        this.version = (Integer) in.readValue(Integer.class.getClassLoader());
    }

    public static final Creator<ProductsBackup> CREATOR = new Creator<ProductsBackup>() {
        @Override
        public ProductsBackup createFromParcel(Parcel source) {
            return new ProductsBackup(source);
        }

        @Override
        public ProductsBackup[] newArray(int size) {
            return new ProductsBackup[size];
        }
    };
}
